package cn.explink.dop.enums;

import java.util.ArrayList;
import java.util.List;

/**
 * @author songkaojun
 */
public enum DeliveryManStatusEnum {

	CAN_ACCEPT(1, "可以接单"), CANNOT_ACCEPT(2, "不可以接单");

	private int value;

	private String text;

	private DeliveryManStatusEnum(int value, String text) {
		this.value = value;
		this.text = text;
	}

	public int getValue() {
		return this.value;
	}

	public String getText() {
		return this.text;
	}

	public static List<DeliveryManStatusEnum> getAllStatus() {
		List<DeliveryManStatusEnum> deliveryManStatusList = new ArrayList<DeliveryManStatusEnum>();
		deliveryManStatusList.add(CAN_ACCEPT);
		deliveryManStatusList.add(CANNOT_ACCEPT);
		return deliveryManStatusList;
	}

	public static String getTextByValue(int value) {
		List<DeliveryManStatusEnum> allStatus = DeliveryManStatusEnum.getAllStatus();
		for (DeliveryManStatusEnum deliveryManStatus : allStatus) {
			if (deliveryManStatus.getValue() == value) {
				return deliveryManStatus.getText();
			}
		}
		return "";
	}
}
